package com.ag.lzm.action;

import java.util.List;

import com.ag.bean.TbEventType;
import com.ag.bean.TbPlanGrade;
import com.ag.bean.TbPlanRegion;
import com.ag.bean.TbPlanScope;
import com.ag.bean.TbPlanStatus;
import com.ag.bean.TbPlanType;
import com.ag.common.AjaxNotify;
import com.ag.common.BaseAction;
import com.ag.lzm.service.IPlanBasisService;

public class FindPlanBasisAction extends BaseAction {
	private static final long serialVersionUID = 2504301690626755445L;
	private String ajaxRst;
	private List<TbPlanType> planTypeList;
	private List<TbPlanStatus> planStatusList;
	private List<TbPlanScope> planScopeList;
	private List<TbPlanRegion> planRegionList;
	private List<TbPlanGrade> planGradeList;
	private List<TbEventType> eventTypeList;
	private IPlanBasisService planBasisService;

	public String getAjaxRst() {
		return ajaxRst;
	}

	/**
	 * 查找所有事件类型
	 * 
	 * @return
	 */
	public String findAllEventType() {
		try {
			eventTypeList = planBasisService.findAllEventType();
//			for (TbEventType ey : eventTypeList) {
//				System.out.println(ey.getEtEventType());
//			}
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_all_event_type";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	/**
	 * 查找所有预案类型
	 * 
	 * @return
	 */
	public String findAllPlanType() {
		try {
			planTypeList = planBasisService.findAllPlanType();
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_all_plan_type";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	/**
	 * 查找所有预案状态
	 * 
	 * @return
	 */
	public String findAllPlanStatus() {
		try {
			planStatusList = planBasisService.findAllPlanStatus();
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_all_plan_status";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	/**
	 * 查找所有预案适用范围
	 * 
	 * @return
	 */
	public String findAllPlanScope() {
		try {
			planScopeList = planBasisService.findAllPlanScope();
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_all_plan_scope";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	/**
	 * 查找所有预案适用区域
	 * 
	 * @return
	 */
	public String findAllPlanRegion() {
		try {
			planRegionList = planBasisService.findAllPlanRegion();
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_all_plan_region";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	/**
	 * 查找所有预案等级
	 * 
	 * @return
	 */
	public String findAllPlanGrade() {
		try {
			planGradeList = planBasisService.findAllPlanGrade();
			ajaxRst = AjaxNotify.SUCCESS;
			return "find_all_plan_grade";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	public List<TbPlanType> getPlanTypeList() {
		return planTypeList;
	}

	public List<TbPlanStatus> getPlanStatusList() {
		return planStatusList;
	}

	public List<TbPlanScope> getPlanScopeList() {
		return planScopeList;
	}

	public List<TbPlanRegion> getPlanRegionList() {
		return planRegionList;
	}

	public List<TbPlanGrade> getPlanGradeList() {
		return planGradeList;
	}

	public void setPlanBasisService(IPlanBasisService planBasisService) {
		this.planBasisService = planBasisService;
	}

	public List<TbEventType> getEventTypeList() {
		return eventTypeList;
	}
}
